package com.cadre.common.utils.oldutil;

import java.util.regex.Pattern;

/* loaded from: StrValidate.class */
public class StrValidate {
    private static String DIGIT_REGEX = "[0-9\\.]+";
    private static String CONTAIN_DIGIT_REGEX = ".*[0-9].*";
    private static String LETTER_REGEX = "[a-zA-Z]+";
    private static String CONTAIN_LETTER_REGEX = ".*[a-zA-z].*";
    private static String CHINESE_REGEX = "[一-龥,.;；，。]";
    private static String LETTER_DIGIT_REGEX = "^[a-z0-9A-Z]+$";
    private static String CHINESE_LETTER_REGEX = "([一-龥]+|[a-zA-Z]+)";
    private static String CHINESE_LETTER_DIGIT_REGEX = "^[a-z0-9A-Z一-龥,.;；，。]+$";

    public static boolean isLetterDigit(String str) {
        return str.matches(LETTER_DIGIT_REGEX);
    }

    public static boolean isChinese(String con) {
        Pattern pattern = Pattern.compile(CHINESE_REGEX);
        for (int i = 0; i < con.length(); i++) {
            if (!pattern.matcher(String.valueOf(con.charAt(i))).find()) {
                return false;
            }
        }
        return true;
    }

    public static boolean isLetterDigitOrChinese(String str) {
        return str.matches(CHINESE_LETTER_DIGIT_REGEX);
    }

    public static boolean checkChineseLetter(String passengerName) {
        if (Pattern.compile(CHINESE_LETTER_REGEX).matcher(passengerName).matches()) {
            return true;
        }
        return false;
    }

    public static boolean checkPunctuation(String ret) {
        boolean b = false;
        if (ret.length() != ret.replaceAll("\\p{P}", "").length()) {
            b = true;
        }
        return b;
    }

    public static boolean isDigit(String ret) {
        return ret.matches(DIGIT_REGEX);
    }

    public static boolean isLetter(String ret) {
        return ret.matches(LETTER_REGEX);
    }

    public static boolean hasDigit(String ret) {
        return ret.matches(CONTAIN_DIGIT_REGEX);
    }

    public static boolean hasLetter(String ret) {
        return ret.matches(CONTAIN_LETTER_REGEX);
    }
}
